package com.haha.Configs;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "mybatis")    // 使用yaml进行绑定
public class Mybatis {
    @Value("这是一个自定义Batis的名字")
    private String name;
    @Value("这是一个自定义Batis的关键词")
    private String keywords;

    public Mybatis() {
    }

    public Mybatis(String name, String keywords) {
        this.name = name;
        this.keywords = keywords;
    }

    public String getName() {
        return name;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    @Override
    public String toString() {
        return "Mybatis{" +
                "name='" + name + '\'' +
                ", keywords='" + keywords + '\'' +
                '}';
    }
}
